package org.dey.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.dey.pojo.Member;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author deyran
 * @date 2022/3/31 15:14
 * @classname
 * @see
 */
@Repository
public interface MemberMapper extends BaseMapper<Member> {

    @Select("SELECT *  FROM t_member")
    @Results(id = "MemberMapper", value = {
            @Result(id = true,column = "id",property = "id"),
            @Result(property = "users",column = "id", many = @Many(select = "org.dey.mapper.UserMapper.findAllByIdUsers"))
    })
    List<Member> memberList(Member member);

}
